<!--交易记录-->

<template>
	<div>
		<div class="my_header">
			<i class="mui-icon mui-icon-arrowleft" aria-hidden="true" @click="$router.back(-1)"></i>
			<div class="top1">购买详情</div>
			
		</div>
		<div class="jyrecord">
			
			<div class="row">
				<div class="left">购买时间</div>
				<div class="right">{{buyddetail.add_time}}</div>
			</div>
			<div class="row">
				<div class="left">套餐名称</div>
				<div class="right">{{buyddetail.name}}</div>
			</div>
			<div class="row">
				<div class="left">套餐价格</div>
				<div class="right">￥{{buyddetail.money}}</div>
			</div>
			<div class="row">
				<div class="left">可查次数</div>
				<div class="right">{{buyddetail.number}}</div>
			</div>
			
			<div class="row">
				<div class="left">剩余总次数</div>
				<div class="right">{{buyddetail.inquiry}}</div>
			</div>
		</div>
		
	</div>
	
</template>

<script>
	export default {

		data() {
			return {

				buyddetail: {},

			};
		},
		created: function() {
			var token = localStorage.getItem("token");
			var that = this;
			var buyid = this.$route.query.tabitem;
			that.getbuydetail(buyid);
		},
		methods: {
			getbuydetail(buyid) {
				console.log(buyid);
				var that = this;			
				$.ajax({
					type: "get",
					url: "http://zcapi.hrgsxt.cn/api/User_record/buy_info",
					data: {
						token: localStorage.getItem("token"),
						record_id: buyid
					},
					cache: false,
					dataType: "json",
					success: function(data) {
						
						if(data.code == 200) {

							that.buyddetail = data.data;

							console.log(JSON.stringify(data.data)+"哈哈");

						} else {

							that.$toast({
								message: data.message,
								duration: 1000
							})

						}

					}
				});
			}

		},

		watch: {
			// 如果路由有变化，会再次执行该方法
			'$route': 'fetchData'
		}
	}

	//图片上传并预览
</script>

<style scoped="scoped">
	/*头部*/
		.my_header {
		height: .88rem;
		background: rgba(0, 133, 240, 1);
		text-align: center;
		color: #fff;
		line-height: .88rem;
		position: relative;
		padding: 0 .3rem;
	}
	
   /*.jyje .right{
   	   color: #FF7E00 !important;
   }*/
	
	.my_header i {
		font-size: .4rem;
		float: left;
		line-height: .88rem;
	}
	
	 .my_header .top1 {
		width: 40%;
		margin-left: 25%;
		float: left;
		text-align: center;
	}
	

	
	/*查询记录*/
	.jyrecord{
		margin-top: 0px !important;
		width: 100%;
		font-size:0.26rem !important;
		background-color: #FFFFFF;
	}


	.jyrecord .row {
		width: 100%;
		height: 0.88rem;
		background-color: #FFFFFF;
		line-height: 0.88rem;
		padding: 0px 0.3rem 0px 0.3rem;
		border-bottom: 1px solid #efefef;		
	}
	
	.jyrecord .row:first-child {
		border-bottom: 1px solid #efefef;
	}
	
	.jyrecord .row .left {
		width: 50%;
		float: left;
		font-size: 0.3rem;
		color: #333333;
	}
	
	.jyrecord .row .right {
		color: #666666;
		width: 50%;
		float: right;
		font-size: 0.28rem;
		line-height: 0.88rem;
		text-align: right;
	}
	
	.jyrecord .row .right img {
		width: 0.14rem;
		height: 0.24rem;
		vertical-align: middle;
		margin-left: 7px;
		margin-bottom: 3px;
	}
	
	.jyrecord .row .right input {
		border: none;
		outline: none;
		text-indent: 4em;
		text-align: right;
		padding-right: 0px !important;
	}
	
</style>